package com.health.circle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.circle.mapper.DiseaseMapper;
import com.health.circle.service.DiseaseService;
import com.health.common.core.po.DiseasePo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @BelongsProject: dimensionality-manage
 * @BelongsPackage: com.health.circle.service.impl
 * @Author: 许力匀
 * @CreateTime: 2024-12-16  19:22
 * @Description: 病症业务层
 * @Version: 1.0
 */
@Service
public class DiseaseServiceImpl extends ServiceImpl<DiseaseMapper, DiseasePo> implements DiseaseService {

    @Autowired
    private DiseaseMapper diseaseMapper;

    @Override
    public List<DiseasePo> getDisease(Integer departmentId) {

        LambdaQueryWrapper<DiseasePo> diseasePoLambdaQueryWrapper = new LambdaQueryWrapper<>();

        diseasePoLambdaQueryWrapper.eq(departmentId!=null && departmentId!=0,DiseasePo::getDepartmentId,departmentId);

        return diseaseMapper.selectList(diseasePoLambdaQueryWrapper);

    }
}
